// 员工相关的api
import request from '@/utils/request'
/**
 * @description 获取员工列表
 * @param {*} parmas 分页信息
 * @returns
 */
export const getEmployeesListAPI = (params) => {
  return request({
    url: '/sys/user',
    params
  })
}

/**
 * @description: 删除员工
 * @param {*} id 员工id
 * @return {*}
 */
export function delEmployeeAPI(id) {
  return request({
    url: `/sys/user/${id}`,
    method: 'delete'
  })
}

/**
 * @description: 新增员工
 * @param {*} id 员工id
 * @return {*}
 */
export function addEmployeeAPI(data) {
  return request({
    url: '/sys/user',
    method: 'POST',
    data
  })
}

/**
 * @description: 批量导入员工
 * @param {*}
 * @return {*}
 */
export function importEmployeeAPI(data) {
  return request({
    url: '/sys/user/batch',
    method: 'POST',
    data
  })
}

/**
 * @description 更新保存员工信息
 * @param { string, number } id 用户 ID
 * @returns
 */
export function updateUserInfoAPI(data) {
  return request({
    url: `/sys/user/${data.id}`,
    method: 'PUT',
    data
  })
}

/**
 * @description 给员工分配角色
 * @param
 * @returns
 */
export function assignRoleAPI(data) {
  return request({
    url: '/sys/user/assignRoles',
    method: 'PUT',
    data
  })
}
